import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * @Author 12629
 * @Date 2022/3/2 21:33
 * @Description：
 */
class Person implements Cloneable{

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class TestDemo2 {

    public static void main(String[] args) {
        int[] array = null;

        try {
            if(array == null) {
                throw new CloneNotSupportedException("哈哈哈哈  你是空指针异常！！！");

            }
        }catch (CloneNotSupportedException e) {
            //e.printStackTrace();
            System.out.println("我去！！！上");
        }
        //throw 一般去抛出自定义的异常 -》 这个课件会讲到
    }

    public static void main9(String[] args) {
        int[] array = null;
        try {
            if(array == null) {
                throw new NullPointerException("哈哈哈哈  你是空指针异常！！！");
            }
        }catch (NullPointerException e) {
            //e.printStackTrace();
            System.out.println("我去！！！上");
        }
        //throw 一般去抛出自定义的异常 -》 这个课件会讲到
    }


    public static void main7(String[] args) {
        try {
            //存放 可能存在异常的代码
            int a = 10/0;
            System.out.println(a);
        }catch (ArithmeticException e) {
            e.printStackTrace();
            System.out.println("抛出了一个ArithmeticException的异常！");
        }
        System.out.println("正常的业务逻辑");
    }



    public static void func() {
        func();
    }

    public static void main3(String[] args) {
        func();
    }


    public static void main2(String[] args) throws CloneNotSupportedException {
        Person person = new Person();
        Person person1 = (Person)person.clone();
    }


    public static void main1(String[] args) {
        int a = 10/0;
        System.out.println(a);
        System.out.println("正常的业务逻辑");
    }

}
